import request from '@/utils/request'

// 创建基础信息仓库
export function createInfoWarehouse(data) {
  return request({
    url: '/pharmaceutical/info-warehouse/create',
    method: 'post',
    data: data
  })
}

// 更新基础信息仓库
export function updateInfoWarehouse(data) {
  return request({
    url: '/pharmaceutical/info-warehouse/update',
    method: 'put',
    data: data
  })
}

// 删除基础信息仓库
export function deleteInfoWarehouse(id) {
  return request({
    url: '/pharmaceutical/info-warehouse/delete?id=' + id,
    method: 'delete'
  })
}

// 获得基础信息仓库
export function getInfoWarehouse(id) {
  return request({
    url: '/pharmaceutical/info-warehouse/get?id=' + id,
    method: 'get'
  })
}

// 获得基础信息仓库分页
export function getInfoWarehousePage(query) {
  return request({
    url: '/pharmaceutical/info-warehouse/page',
    method: 'get',
    params: query
  })
}

// 导出基础信息仓库 Excel
export function exportInfoWarehouseExcel(query) {
  return request({
    url: '/pharmaceutical/info-warehouse/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

// 获得商品分类列表
export function listWarehouse(query) {
  return request({
    url: '/pharmaceutical/info-warehouse/list',
    method: 'get',
    params: query
  })
}

//获取分类列表Tree
export function listWarehouseTree(query) {
  return request({
    url: '/pharmaceutical/info-warehouse/getInfoWarehouseList',
    method: 'get',
    params: query
  })
}